require "luajit-stdlib.__tableUtil";
require "luajit-stdlib.__ioUtil";
require "luajit-stdlib.__console";
---@全局错误捕获
_G.onError = nil;

local file = arg[#arg];
local func, err = loadfile(file, "t");
if err then
    error(err, 1);
end
local ok, err = pcall(func);
if err then
    if _G.onError then
        _G.onError(err)
        return
    end
    error("\n" .. err, 1);
end
